package day03;
/**字符串连接运算符的演示*/
public class OperDemo5 {
    public static void main(String[] args) {
        //5）字符串连接运算符：+
        int age = 40;
        System.out.println("age=");  //age=
        System.out.println(age);  //40
        System.out.println("age="+age);  //age=40
        System.out.println("我今年"+age+"岁了"); //我今年40岁了

        String name = "张三";  //声明字符串型变量name，并赋值为 张三
        System.out.println("大家好，我叫"+name);  //大家好，我叫张三
        System.out.println("大家好，我叫"+name+",今年"+age+"岁了");  //大家好，我叫张三，今年40岁了

        System.out.println(10+20+""+30);  //3030
        System.out.println(""+10+20+30);  //102030
        System.out.println(10+20+30+"");  //60

    }
}
